<?php
class inman_finder_stores{
	public function __construct(){
		$this->app=app::get('inman');
	}


	var $detail_store='店铺信息';
	public function detail_store($id){
		header("content-type:text/html;charset=utf-8");
		//var_dump(func_get_arg(0));die;
		$render=$this->app->render();
		$stores=$this->app->model('stores')->getList('*',array('store_id'=>$id));
		$render->pagedata['store']=$stores[0];
		return $render->fetch('admin/stores/lookstore.html');
	}
	var $detail_edit='店铺编辑';
	public function detail_edit($id){
		// echo 'xxx';
		header("content-type:text/html;charset=utf-8");
		$render=$this->app->render();
		$stores=$this->app->model('stores')->getList('*',array('store_id'=>$id));
		$render->pagedata['store']=$stores[0];
		return $render->fetch('admin/stores/edit.html');
		
	}
	var $column_store_pic='缩略图';
	var $column_store_pic_order = COLUMN_IN_HEAD;
	//var $column_store_pic_order_field = 'image_default_id';
	public function column_store_pic($row){
		$o = kernel::single('inman_mdl_stores');// app::get('inman')->model('stores');
		$image_id=$o->getRow('store_image_id',array('store_id'=>$row['store_id']));
		$img_src = base_storager::image_path($image_id['store_image_id'],'s' );
		if(!$img_src)return '';
		return "<a href='$img_src' class='img-tip pointer' target='_blank' onmouseover='bindFinderColTip(event);'><span>&nbsp;pic</span></a>";
	}
	//分销商绑定店铺的信息
	var $detail_user='分销商信息';
	public function detail_user($id){
		$stores=$this->app->model('stores')->getRow('*',array('store_id'=>$id));
		$render=$this->app->render();
		$render->pagedata['store']=$stores;
		return $render->fetch('admin/stores/user.html');
	}
	
}